<?php


namespace app\controller;

use app\service\LoveService;
use think\facade\Request;

/**
 * 收藏
 */
class LoveController
{
    /**
     * 收藏商品
     */
    public function goodsLoveAdd() {

        $param['user_uuid'] = Request::param('user_uuid');
        $param['goods_uuid'] = Request::param('goods_uuid');

        return json(LoveService::goodsLoveAdd($param));
    }

    /**
     * 取消收藏商品
     */
    public function goodsLoveReduce() {

        $param['user_uuid'] = Request::param('user_uuid');
        $param['goods_uuid'] = Request::param('goods_uuid');

        return json(LoveService::goodsLoveReduce($param));
    }

    /**
     * 返回用户收藏商品列表
     */
    public function goodsLoveList() {

        $param['user_uuid'] = Request::param('user_uuid');
        $param['startPage'] = Request::param('startPage');
        $param['endPage'] = Request::param('endPage');

        return json(LoveService::goodsLoveList($param));
    }
}
